package com.gdssoft.pdaweb.dao.water.impl;

/*
 *  捷达世软件(深圳)有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
 */
import java.util.ArrayList;
import java.util.List;
import com.gdssoft.core.dao.impl.BaseDaoImpl;
import com.gdssoft.pdaweb.dao.water.WaterMeterMonthPlanReadDao;
import com.gdssoft.pdaweb.model.water.PdaWaterList;
import com.gdssoft.pdaweb.model.water.WaterMeterMonthPlan;
import com.gdssoft.pdaweb.model.water.WaterMeterMonthPlanRead;

@SuppressWarnings("unchecked")
public class WaterMeterMonthPlanReadDaoImpl extends BaseDaoImpl<WaterMeterMonthPlanRead> 
implements WaterMeterMonthPlanReadDao {

	public WaterMeterMonthPlanReadDaoImpl() {
		super(WaterMeterMonthPlanRead.class);
	}


	@Override
	public List<WaterMeterMonthPlanRead> getPlanTask(String meterId,String month,long planId) {
		String hql = "from WaterMeterMonthPlanRead where meterID = '"+meterId+"' and month = '"+month+"' and planID='"+planId+"'";
		List<WaterMeterMonthPlanRead> ls = new ArrayList<WaterMeterMonthPlanRead>();
		ls = this.findByHql(hql);
		if(ls.size()>0)
		{
		   return ls;
		}
		return new ArrayList<WaterMeterMonthPlanRead>(); 
	}
	
	@Override
	public List<WaterMeterMonthPlanRead> getByIdAndMonth(Long id, String month) 
	{
		String hql="from WaterMeterMonthPlanRead where planID=? and month=?";
		return this.findByHql(hql, new Object[]{id, month});
	}

}

